<template>
  <page-form :x-uri="uri" :bind-options="options" :custom-components="custom">
    <!-- 自定义tab -->
    <template v-slot:page-tabs>
      <tabs :tabs="tabs" />
    </template>
  </page-form>
</template>

<script>
import PageForm from '@public/template/page_form.vue';
import ChooseCourse from './components/course.vue';
import Tabs from '../tabs';
export default {
  components: {
    PageForm,
    Tabs
  },
  data() {
    return {
      uri: '/course/admin/coupon/offline/courseCard/' + this.$route.params.id + '/edit',
      tabs: [
        {
          title: '编辑课程卡',
          uri: '/market/coupon/offline/courseCard/' + this.$route.params.id + '/edit',
          meta: {
            permission: 'market.coupon.offline.coursecard.create'
          }
        }
      ],
      options: {
        use_time: {
          disabledDate: function(time) {
            return time.getTime() + 8.64e7 < Date.now();
          }
        },
        derive_time: {
          disabledDate: function(time) {
            return time.getTime() + 8.64e7 < Date.now();
          }
        }
      },
      custom: {
        course_id: ChooseCourse
      }
    };
  }
};
</script>
